package com.example.springboot_demo.demos.web.book_work.Mapper;


import com.example.springboot_demo.demos.web.book_work.Pojo.entity.User;
import com.example.springboot_demo.demos.web.book_work.Pojo.vo.UserVo;
import org.apache.ibatis.annotations.*;

@Mapper
public interface BookUserMapper {

    @Results(@Result(property = "userId",column = "id"))
    @Select("select * from user where id = #{id}")
    UserVo getUserById(Integer id);

   @Update("update user set name = #{name}, borrowed_books = #{borrowedBooks} where id = #{id}")
    int UpdateUser(@Param("name") String name,@Param("borrowedBooks") String borrowedBooks, @Param("id") Long id);
}
